io_uring: ensure symmetry in handling iter types in loop_rw_iter()
authorJens Axboe <axboe@kernel.dk>
Sun, 12 Sep 2021 12:45:07 +0000 (06:45 -0600)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 28 Sep 2021 04:29:40 +0000 (05:29 +0100)
commit204f280a9f986aa267d1d5f8e5ecd3e6aad94c5a
tree267be3720ad000fc4d7e76e8486c191ff9c924d2
parent96a71b25da8b83cda7ceee28cd5a6664e6c72321
io_uring: ensure symmetry in handling iter types in loop_rw_iter()

Origin: https://git.kernel.org/linus/16c8d2df7ec0eed31b7d3b61cb13206a7fb930cc
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2021-41073

When setting up the next segment, we check what type the iter is and
handle it accordingly. However, when incrementing and processed amount
we do not, and both iter advance and addr/len are adjusted, regardless
of type. Split the increment side just like we do on the setup side.

Fixes: 4017eb91a9e7 ("io_uring: make loop_rw_iter() use original user supplied pointers")
Cc: stable@vger.kernel.org
Reported-by: Valentina Palmiotti <vpalmiotti@gmail.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name io_uring-ensure-symmetry-in-handling-iter-types-in-l.patch
fs/io_uring.c